#define  _CRT_SECURE_NO_WARNINGS


#include<stdio.h>

int main()
{
	int a = 0;
	int b = 0;
	int c = 0;
	char sign = 0;
	int count = 0;
	int k = 0;
	while (scanf("%d%c%d=%d", &a, &sign, &b, &c) != EOF)
	{
		if (k == 3) 
			getchar();
		else if (c == a + b && sign == '+')
			count++;
		else if (c == a - b && sign == '-')
			count++;
	}
	printf("%d\n", count);
	

	return 0;
}